package cn.zhentao.charge.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import cn.zhentao.charge.mapper.ChargeRecordMapper;
import cn.zhentao.charge.domain.ChargeRecord;
import cn.zhentao.charge.service.IChargeRecordService;

/**
 * 充电记录Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-05-15
 */
@Service
public class ChargeRecordServiceImpl implements IChargeRecordService 
{
    @Autowired
    private ChargeRecordMapper chargeRecordMapper;

    /**
     * 查询充电记录
     * 
     * @param id 充电记录主键
     * @return 充电记录
     */
    @Override
    public ChargeRecord selectChargeRecordById(Integer id)
    {
        return chargeRecordMapper.selectChargeRecordById(id);
    }

    /**
     * 查询充电记录列表
     * 
     * @param chargeRecord 充电记录
     * @return 充电记录
     */
    @Override
    public List<ChargeRecord> selectChargeRecordList(ChargeRecord chargeRecord)
    {
        return chargeRecordMapper.selectChargeRecordList(chargeRecord);
    }

    /**
     * 新增充电记录
     * 
     * @param chargeRecord 充电记录
     * @return 结果
     */
    @Override
    public int insertChargeRecord(ChargeRecord chargeRecord)
    {
        chargeRecord.setCreateTime(DateUtils.getNowDate());
        return chargeRecordMapper.insertChargeRecord(chargeRecord);
    }

    /**
     * 修改充电记录
     * 
     * @param chargeRecord 充电记录
     * @return 结果
     */
    @Override
    public int updateChargeRecord(ChargeRecord chargeRecord)
    {
        return chargeRecordMapper.updateChargeRecord(chargeRecord);
    }

    /**
     * 批量删除充电记录
     * 
     * @param ids 需要删除的充电记录主键
     * @return 结果
     */
    @Override
    public int deleteChargeRecordByIds(Integer[] ids)
    {
        return chargeRecordMapper.deleteChargeRecordByIds(ids);
    }

    /**
     * 删除充电记录信息
     * 
     * @param id 充电记录主键
     * @return 结果
     */
    @Override
    public int deleteChargeRecordById(Integer id)
    {
        return chargeRecordMapper.deleteChargeRecordById(id);
    }
}
